#include "fxcc/core/graph/common/AnimTransitionChannel.h"

using namespace fxcc::graph::common;

void AnimTransitionChannel::SetEntityMap(double leftTick, double rightTick, float middleAxis)
{
	Transform leftTransform = m_Left.GetSlerpMatrix(leftTick);
	Transform rightTransform = m_Right.GetSlerpMatrix(rightTick);

	auto local = Transform::Slerp(leftTransform, rightTransform, middleAxis);
	m_Entity->SetTranform(local);
	
	//auto& transformNode = m_Entity->GetLocalTransform();

	//if (m_KeyMap.x)
	//{
	//	transformNode.m_Local.m_Position = local.m_Position;
	//}
	//if (m_KeyMap.y)
	//{
	//	transformNode.m_Local.m_Rotation = local.m_Rotation;
	//}
	//if (m_KeyMap.z)
	//{
	//	transformNode.m_Local.m_Scale = local.m_Scale;
	//}
}